# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-net-http-digest_auth
_gemname=net-http-digest_auth
pkgver=1.4.1
pkgrel=15
pkgdesc='An implementation of RFC 2617 - Digest Access Authentication.'
arch=('any')
license=('custom:unknown')
makedepends=('ruby')
url='http://github.com/drbrain/net-http-digest_auth'
source=("http://rubygems.org/downloads/$_gemname-$pkgver.gem")
sha512sums=('db62d49815a96cabde5836b00a1df58d6277f9efafae78e27296b1e2f4410ea613aed2181f8e39f08af5bbf6f5f758d682e1250d0afd4fe8243fb0d5c7fe78b7')
noextract=("$_gemname-$pkgver.gem")

package() {
  _gemdir=$(ruby -e 'puts Gem.default_dir')

  if [[ $CARCH == arm* ]] ; then
    gem install --no-user-install --ignore-dependencies --no-rdoc --no-ri \
      -i "$pkgdir$_gemdir" "$_gemname-$pkgver.gem"
  else
    gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" \
      -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
  fi
}

